#include "ProgressBar.h"
#include "CommCtrl.h"
ProgressBar::ProgressBar()
{
}
ProgressBar::~ProgressBar()
{
	DestroyWindow(m_hWnd);
}
bool ProgressBar::Setup(HWND a_hWnd, HINSTANCE a_hInst, int a_xPos, int a_yPos, int a_width, int a_height)
{
	m_hWnd = CreateWindowEx(NULL, PROGRESS_CLASS, NULL, WS_CHILD | WS_VISIBLE, a_xPos, a_yPos, a_width, a_height, a_hWnd, NULL, a_hInst, NULL);
	if(m_hWnd == NULL)
	{
		return false;
	}

	UpdateWindow(m_hWnd);
	ShowWindow(m_hWnd, SW_SHOW);

	return true;
}
void ProgressBar::SetMarqueeMode(bool a_val)
{
	SendMessage(m_hWnd, PBM_SETMARQUEE, (WPARAM)a_val, 0);
}
void ProgressBar::Step()
{
	SendMessage(m_hWnd, PBM_STEPIT, 0, 0);	
}
void ProgressBar::SetStep(int a_val)
{
	SendMessage(m_hWnd, PBM_SETSTEP, (WPARAM)a_val, 0);
}
void ProgressBar::SetRange(int a_min, int a_max)
{
	SendMessage(m_hWnd, PBM_SETRANGE, 0, MAKELPARAM(a_min, a_max));
}
void ProgressBar::Reset()
{
	SendMessage(m_hWnd, PBM_SETPOS, (WPARAM)0, 0);	
}